import { reqJson } from './requestWithToken';
import domain from '@/utils/domain';

export async function indexPage(params) {
  const url = `${domain.user}/sys/dict/index/page`;
  return reqJson.get(url, params);
}

export async function indexUpdate(params) {
  const url = `${domain.user}/sys/dict/index/update`;
  return reqJson.postJson(url, params);
}

export async function indexRemove(indexId) {
  const url = `${domain.user}/sys/dict/index/remove/${indexId}`;
  return reqJson.post(url);
}

export async function valueList(params) {
  const url = `${domain.user}/sys/dict/value/list`;
  return reqJson.get(url, params);
}

export async function valueListByIndexCode(params) {
  const url = `${domain.user}/sys/dict/value/code/list`;
  return reqJson.get(url, params);
}

export async function valueUpdate(params) {
  const url = `${domain.user}/sys/dict/value/update`;
  return reqJson.postJson(url, params);
}

export async function valueRemove(valueId) {
  const url = `${domain.user}/sys/dict/value/remove/${valueId}`;
  return reqJson.post(url);
}
